﻿<!DOCTYPE html>
<html>

<head>
    <title>Pubnub - Demo</title>
</head>

<body>
	<div 
        pub-key="pub-c-e32a4279-7190-4426-8ca8-e2771abeb561" 
        sub-key="sub-c-3a318502-059b-11e3-991c-02ee2ddab7fe" 
        ssl="off" origin="pubsub.pubnub.com" id="pubnub"></div>
    <script src=http://cdn.pubnub.com/pubnub-3.5.3.min.js></script>
    <h1>Listening for messages from Pubnub...</h1>
    <textarea id="messagesArea" style="width:300px; height:300px"></textarea>
    <script>
        (function() {
            document.write("")
            PUBNUB.subscribe({
                channel: "chat-channel", 
                callback: function (message) { 
                    // Received a message --> print it in the page
                    document.getElementById('messagesArea').innerHTML += message + '\n';
                }
            });
        })();
    </script>
</body>

</html>